home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / HYPERBOOK2.DMS / in.adf / Macros / FileToNote{fname} < prev    next >
Encoding:
Text File  |  1990-09-23  |  727 b   |  31 lines

  1. /* FileToNote(fname)
  2.  
  3.    Create a note containing the contents of the given text file, and
  4.    locate it on the current page. The note has the same name as the file,
  5.    and an arbitrary position and size that can be changed to suit. Other
  6.    characteristics come from the default note, and the last note created.
  7.    Beware of using this macro on anything other than short text files!
  8. */
  9.  
  10. if open(fr, arg(1), 'r') then do
  11.  
  12.    note = createnote()
  13.  
  14.    do forever
  15.  
  16.       line = readln(fr) || '0a'x
  17.  
  18.       if eof(fr) then leave
  19.  
  20.       call inserttext(note, line, -1)
  21.       end
  22.  
  23.    call close(fr)
  24.  
  25.    call scaletosize(note, 320, 80)
  26.    call setposition(note,  60, 40)
  27.    call setname(note, arg(1))
  28.    call relocate(note, ':')
  29.  
  30.    end
  31.